// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod sql_backup_runs_service {
    use crate::Result;

    /// A builder for [SqlBackupRunsService][crate::client::SqlBackupRunsService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_backup_runs_service::ClientBuilder;
    /// # use client::SqlBackupRunsService;
    /// let builder : ClientBuilder = SqlBackupRunsService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlBackupRunsService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlBackupRunsService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlBackupRunsService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlBackupRunsService::delete][crate::client::SqlBackupRunsService::delete] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_backup_runs_service::Delete;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Delete {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);

    impl Delete {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .delete(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
        pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.id = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Delete {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlBackupRunsService::get][crate::client::SqlBackupRunsService::get] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_backup_runs_service::Get;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Get {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);

    impl Get {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::BackupRun> {
            (*self.0.stub)
                .get(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
        pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.id = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Get {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlBackupRunsService::insert][crate::client::SqlBackupRunsService::insert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_backup_runs_service::Insert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Insert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);

    impl Insert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .insert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::BackupRun>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::BackupRun>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Insert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlBackupRunsService::list][crate::client::SqlBackupRunsService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_backup_runs_service::List;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::BackupRunsListResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::BackupRunsListResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
        pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.max_results = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_connect_service {
    use crate::Result;

    /// A builder for [SqlConnectService][crate::client::SqlConnectService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_connect_service::ClientBuilder;
    /// # use client::SqlConnectService;
    /// let builder : ClientBuilder = SqlConnectService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlConnectService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlConnectService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlConnectService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlConnectService::get_connect_settings][crate::client::SqlConnectService::get_connect_settings] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_connect_service::GetConnectSettings;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetConnectSettings {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);

    impl GetConnectSettings {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ConnectSettings> {
            (*self.0.stub)
                .get_connect_settings(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
        pub fn set_read_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetConnectSettings {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlConnectService::generate_ephemeral_cert][crate::client::SqlConnectService::generate_ephemeral_cert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_connect_service::GenerateEphemeralCert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GenerateEphemeralCert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);

    impl GenerateEphemeralCert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
            (*self.0.stub)
                .generate_ephemeral_cert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
        pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.public_key = v.into();
            self
        }

        /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
        pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.access_token = v.into();
            self
        }

        /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
        pub fn set_read_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
        pub fn set_valid_duration<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.valid_duration = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
        pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.valid_duration = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GenerateEphemeralCert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_databases_service {
    use crate::Result;

    /// A builder for [SqlDatabasesService][crate::client::SqlDatabasesService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_databases_service::ClientBuilder;
    /// # use client::SqlDatabasesService;
    /// let builder : ClientBuilder = SqlDatabasesService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlDatabasesService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlDatabasesService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlDatabasesService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlDatabasesService::delete][crate::client::SqlDatabasesService::delete] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_databases_service::Delete;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Delete {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);

    impl Delete {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .delete(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.database = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Delete {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlDatabasesService::get][crate::client::SqlDatabasesService::get] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_databases_service::Get;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Get {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);

    impl Get {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Database> {
            (*self.0.stub)
                .get(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.database = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Get {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlDatabasesService::insert][crate::client::SqlDatabasesService::insert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_databases_service::Insert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Insert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);

    impl Insert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .insert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Database>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Database>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Insert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlDatabasesService::list][crate::client::SqlDatabasesService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_databases_service::List;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlDatabasesService::patch][crate::client::SqlDatabasesService::patch] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_databases_service::Patch;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Patch {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);

    impl Patch {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .patch(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.database = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Database>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Database>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Patch {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlDatabasesService::update][crate::client::SqlDatabasesService::update] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_databases_service::Update;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Update {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);

    impl Update {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .update(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.database = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Database>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Database>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Update {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_flags_service {
    use crate::Result;

    /// A builder for [SqlFlagsService][crate::client::SqlFlagsService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_flags_service::ClientBuilder;
    /// # use client::SqlFlagsService;
    /// let builder : ClientBuilder = SqlFlagsService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlFlagsService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlFlagsService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlFlagsService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlFlagsService::list][crate::client::SqlFlagsService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_flags_service::List;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
        pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.database_version = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_instances_service {
    use crate::Result;

    /// A builder for [SqlInstancesService][crate::client::SqlInstancesService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_instances_service::ClientBuilder;
    /// # use client::SqlInstancesService;
    /// let builder : ClientBuilder = SqlInstancesService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlInstancesService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlInstancesService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlInstancesService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlInstancesService::add_server_ca][crate::client::SqlInstancesService::add_server_ca] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::AddServerCa;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AddServerCa {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);

    impl AddServerCa {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .add_server_ca(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AddServerCa {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::clone][crate::client::SqlInstancesService::clone] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Clone;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Clone {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);

    impl Clone {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .clone(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesCloneRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesCloneRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Clone {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::delete][crate::client::SqlInstancesService::delete] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Delete;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Delete {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);

    impl Delete {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .delete(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Delete {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::demote_master][crate::client::SqlInstancesService::demote_master] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::DemoteMaster;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DemoteMaster {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);

    impl DemoteMaster {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .demote_master(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DemoteMaster {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::demote][crate::client::SqlInstancesService::demote] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Demote;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Demote {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);

    impl Demote {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .demote(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
        ///
        /// This is a **required** field for requests.
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
        ///
        /// This is a **required** field for requests.
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesDemoteRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesDemoteRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Demote {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::export][crate::client::SqlInstancesService::export] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Export;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Export {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);

    impl Export {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .export(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesExportRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesExportRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Export {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::failover][crate::client::SqlInstancesService::failover] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Failover;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Failover {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);

    impl Failover {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .failover(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesFailoverRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesFailoverRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Failover {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::reencrypt][crate::client::SqlInstancesService::reencrypt] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Reencrypt;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Reencrypt {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);

    impl Reencrypt {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .reencrypt(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesReencryptRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesReencryptRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Reencrypt {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::get][crate::client::SqlInstancesService::get] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Get;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Get {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);

    impl Get {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
            (*self.0.stub)
                .get(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Get {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::import][crate::client::SqlInstancesService::import] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Import;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Import {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);

    impl Import {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .import(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesImportRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesImportRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Import {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::insert][crate::client::SqlInstancesService::insert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Insert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Insert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);

    impl Insert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .insert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DatabaseInstance>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DatabaseInstance>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Insert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::list][crate::client::SqlInstancesService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::List;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::InstancesListResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::InstancesListResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
            self.0.request.max_results = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::list_server_cas][crate::client::SqlInstancesService::list_server_cas] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::ListServerCas;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListServerCas {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);

    impl ListServerCas {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
            (*self.0.stub)
                .list_server_cas(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListServerCas {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::patch][crate::client::SqlInstancesService::patch] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Patch;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Patch {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);

    impl Patch {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .patch(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DatabaseInstance>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DatabaseInstance>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Patch {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::promote_replica][crate::client::SqlInstancesService::promote_replica] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::PromoteReplica;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> PromoteReplica {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);

    impl PromoteReplica {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .promote_replica(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
        pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.failover = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for PromoteReplica {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::switchover][crate::client::SqlInstancesService::switchover] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Switchover;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Switchover {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);

    impl Switchover {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .switchover(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
        pub fn set_db_timeout<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.db_timeout = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
        pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.db_timeout = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Switchover {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::reset_ssl_config][crate::client::SqlInstancesService::reset_ssl_config] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::ResetSslConfig;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ResetSslConfig {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);

    impl ResetSslConfig {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .reset_ssl_config(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ResetSslConfig {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::restart][crate::client::SqlInstancesService::restart] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Restart;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Restart {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);

    impl Restart {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .restart(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Restart {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::restore_backup][crate::client::SqlInstancesService::restore_backup] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::RestoreBackup;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> RestoreBackup {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);

    impl RestoreBackup {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .restore_backup(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for RestoreBackup {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::rotate_server_ca][crate::client::SqlInstancesService::rotate_server_ca] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::RotateServerCa;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> RotateServerCa {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);

    impl RotateServerCa {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .rotate_server_ca(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for RotateServerCa {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::start_replica][crate::client::SqlInstancesService::start_replica] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::StartReplica;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> StartReplica {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);

    impl StartReplica {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .start_replica(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for StartReplica {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::stop_replica][crate::client::SqlInstancesService::stop_replica] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::StopReplica;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> StopReplica {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);

    impl StopReplica {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .stop_replica(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for StopReplica {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::truncate_log][crate::client::SqlInstancesService::truncate_log] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::TruncateLog;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> TruncateLog {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);

    impl TruncateLog {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .truncate_log(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for TruncateLog {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::update][crate::client::SqlInstancesService::update] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::Update;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Update {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);

    impl Update {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .update(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DatabaseInstance>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DatabaseInstance>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Update {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::create_ephemeral][crate::client::SqlInstancesService::create_ephemeral] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::CreateEphemeral;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateEphemeral {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateEphemeral(
        RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
    );

    impl CreateEphemeral {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SslCert> {
            (*self.0.stub)
                .create_ephemeral(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateEphemeral {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::reschedule_maintenance][crate::client::SqlInstancesService::reschedule_maintenance] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::RescheduleMaintenance;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> RescheduleMaintenance {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct RescheduleMaintenance(
        RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
    );

    impl RescheduleMaintenance {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .reschedule_maintenance(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for RescheduleMaintenance {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::verify_external_sync_settings][crate::client::SqlInstancesService::verify_external_sync_settings] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::VerifyExternalSyncSettings;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> VerifyExternalSyncSettings {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct VerifyExternalSyncSettings(
        RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
    );

    impl VerifyExternalSyncSettings {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(
            self,
        ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
            (*self.0.stub)
                .verify_external_sync_settings(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
        pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.verify_connection_only = v.into();
            self
        }

        /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
        pub fn set_sync_mode<
            T: Into<
                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
            >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.sync_mode = v.into();
            self
        }

        /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
        pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.verify_replication_only = v.into();
            self
        }

        /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
        pub fn set_migration_type<
            T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.migration_type = v.into();
            self
        }

        /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
        pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.sync_parallel_level = v.into();
            self
        }

        /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
        ///
        /// Note that all the setters affecting `sync_config` are
        /// mutually exclusive.
        pub fn set_sync_config<
            T: Into<
                Option<
                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
                >,
            >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.sync_config = v.into();
            self
        }

        /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
        /// to hold a `MysqlSyncConfig`.
        ///
        /// Note that all the setters affecting `sync_config` are
        /// mutually exclusive.
        pub fn set_mysql_sync_config<
            T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_mysql_sync_config(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for VerifyExternalSyncSettings {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::start_external_sync][crate::client::SqlInstancesService::start_external_sync] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::StartExternalSync;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> StartExternalSync {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct StartExternalSync(
        RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
    );

    impl StartExternalSync {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .start_external_sync(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
        pub fn set_sync_mode<
            T: Into<
                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
            >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.sync_mode = v.into();
            self
        }

        /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
        pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.skip_verification = v.into();
            self
        }

        /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
        pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.sync_parallel_level = v.into();
            self
        }

        /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
        pub fn set_migration_type<
            T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.migration_type = v.into();
            self
        }

        /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
        ///
        /// Note that all the setters affecting `sync_config` are
        /// mutually exclusive.
        pub fn set_sync_config<
            T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.sync_config = v.into();
            self
        }

        /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
        /// to hold a `MysqlSyncConfig`.
        ///
        /// Note that all the setters affecting `sync_config` are
        /// mutually exclusive.
        pub fn set_mysql_sync_config<
            T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_mysql_sync_config(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for StartExternalSync {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::perform_disk_shrink][crate::client::SqlInstancesService::perform_disk_shrink] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::PerformDiskShrink;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> PerformDiskShrink {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct PerformDiskShrink(
        RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
    );

    impl PerformDiskShrink {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .perform_disk_shrink(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for PerformDiskShrink {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::get_disk_shrink_config][crate::client::SqlInstancesService::get_disk_shrink_config] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::GetDiskShrinkConfig;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetDiskShrinkConfig {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetDiskShrinkConfig(
        RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
    );

    impl GetDiskShrinkConfig {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
            (*self.0.stub)
                .get_disk_shrink_config(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetDiskShrinkConfig {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::reset_replica_size][crate::client::SqlInstancesService::reset_replica_size] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::ResetReplicaSize;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ResetReplicaSize {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);

    impl ResetReplicaSize {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .reset_replica_size(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ResetReplicaSize {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::get_latest_recovery_time][crate::client::SqlInstancesService::get_latest_recovery_time] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::GetLatestRecoveryTime;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetLatestRecoveryTime {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetLatestRecoveryTime(
        RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
    );

    impl GetLatestRecoveryTime {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
            (*self.0.stub)
                .get_latest_recovery_time(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetLatestRecoveryTime {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::acquire_ssrs_lease][crate::client::SqlInstancesService::acquire_ssrs_lease] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::AcquireSsrsLease;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AcquireSsrsLease {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);

    impl AcquireSsrsLease {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
            (*self.0.stub)
                .acquire_ssrs_lease(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
        ///
        /// This is a **required** field for requests.
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
        ///
        /// This is a **required** field for requests.
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AcquireSsrsLease {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlInstancesService::release_ssrs_lease][crate::client::SqlInstancesService::release_ssrs_lease] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_instances_service::ReleaseSsrsLease;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ReleaseSsrsLease {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);

    impl ReleaseSsrsLease {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
            (*self.0.stub)
                .release_ssrs_lease(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
        ///
        /// This is a **required** field for requests.
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ReleaseSsrsLease {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_operations_service {
    use crate::Result;

    /// A builder for [SqlOperationsService][crate::client::SqlOperationsService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_operations_service::ClientBuilder;
    /// # use client::SqlOperationsService;
    /// let builder : ClientBuilder = SqlOperationsService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlOperationsService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlOperationsService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlOperationsService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlOperationsService::get][crate::client::SqlOperationsService::get] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_operations_service::Get;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Get {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);

    impl Get {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .get(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.operation = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Get {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlOperationsService::list][crate::client::SqlOperationsService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_operations_service::List;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::OperationsListResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::OperationsListResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
            self.0.request.max_results = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlOperationsService::cancel][crate::client::SqlOperationsService::cancel] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_operations_service::Cancel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Cancel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);

    impl Cancel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .cancel(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.operation = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Cancel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_ssl_certs_service {
    use crate::Result;

    /// A builder for [SqlSslCertsService][crate::client::SqlSslCertsService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_ssl_certs_service::ClientBuilder;
    /// # use client::SqlSslCertsService;
    /// let builder : ClientBuilder = SqlSslCertsService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlSslCertsService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlSslCertsService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlSslCertsService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlSslCertsService::delete][crate::client::SqlSslCertsService::delete] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_ssl_certs_service::Delete;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Delete {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);

    impl Delete {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .delete(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.sha1_fingerprint = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Delete {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlSslCertsService::get][crate::client::SqlSslCertsService::get] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_ssl_certs_service::Get;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Get {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);

    impl Get {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SslCert> {
            (*self.0.stub)
                .get(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.sha1_fingerprint = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Get {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlSslCertsService::insert][crate::client::SqlSslCertsService::insert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_ssl_certs_service::Insert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Insert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);

    impl Insert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
            (*self.0.stub)
                .insert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Insert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlSslCertsService::list][crate::client::SqlSslCertsService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_ssl_certs_service::List;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_tiers_service {
    use crate::Result;

    /// A builder for [SqlTiersService][crate::client::SqlTiersService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_tiers_service::ClientBuilder;
    /// # use client::SqlTiersService;
    /// let builder : ClientBuilder = SqlTiersService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlTiersService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlTiersService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlTiersService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlTiersService::list][crate::client::SqlTiersService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_tiers_service::List;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::TiersListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod sql_users_service {
    use crate::Result;

    /// A builder for [SqlUsersService][crate::client::SqlUsersService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_sql_v1::*;
    /// # use builder::sql_users_service::ClientBuilder;
    /// # use client::SqlUsersService;
    /// let builder : ClientBuilder = SqlUsersService::builder();
    /// let client = builder
    ///     .with_endpoint("https://sqladmin.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SqlUsersService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SqlUsersService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SqlUsersService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SqlUsersService::delete][crate::client::SqlUsersService::delete] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_users_service::Delete;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Delete {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);

    impl Delete {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .delete(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.host = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Delete {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlUsersService::get][crate::client::SqlUsersService::get] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_users_service::Get;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Get {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);

    impl Get {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::User> {
            (*self.0.stub)
                .get(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.host = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Get {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlUsersService::insert][crate::client::SqlUsersService::insert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_users_service::Insert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Insert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);

    impl Insert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .insert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::User>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::User>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Insert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlUsersService::list][crate::client::SqlUsersService::list] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_users_service::List;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> List {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);

    impl List {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::UsersListResponse> {
            (*self.0.stub)
                .list(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for List {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SqlUsersService::update][crate::client::SqlUsersService::update] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_sql_v1::builder;
    /// use builder::sql_users_service::Update;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> Update {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);

    impl Update {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Operation> {
            (*self.0.stub)
                .update(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.host = v.into();
            self
        }

        /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.instance = v.into();
            self
        }

        /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::User>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::User>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for Update {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
